import { defineStore } from "pinia"
import { ref } from "vue"

export const usejianliStore = defineStore(
	"jianli",
	() => {
		const jianli_menu_list = ref([
			{
				label: "个人介绍",
				to_name: "introduction",
				id: 0,
			},
			{
				label: "教育&技能",
				to_name: "konwHow",
				id: 1,
			},
			{
				label: "作品",
				to_name: "bn-works",
				id: 2,
			},
			{
				label: "我的详情",
				to_name: "callme",
				id: 3,
			},
		])
		const select_menu_num = ref(0)

		const setSelectMenuNum = (num) => {
			select_menu_num.value = num
		}
		return {
			jianli_menu_list,
			select_menu_num,
			setSelectMenuNum,
		}
	},
	{
		persist: {
			enabled: true,
			strategies: {
				user: {
					storage: localStorage,
					paths: ["select_menu_num"],
				},
			},
		},
	}
)
